<!doctype html>
<html lang="{{ app()->getLocale() }}">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
@if(app('env')=='production')
<link rel="stylesheet" href="{{ secure_asset('/css/pure-min.css') }}">
<link rel="stylesheet" href="{{ secure_asset('/css/main.css') }}">
<link rel="stylesheet" href="{{ secure_asset('/css/login.css') }}">
<script src="{{ secure_asset('/js/login.js') }}"></script>
<link rel="stylesheet" href="{{ secure_asset('/bootstrap/css/bootstrap.css') }}">
<script src="{{ secure_asset('/bootstrap/js/bootstrap.js') }}"></script>
<script src="{{ secure_asset('js/jquery-3.3.1.min.js') }}">
@else
<!-- SSLではない場合 -->
<link rel="stylesheet" href="{{ asset('/css/pure-min.css') }}">
<link rel="stylesheet" href="{{ asset('/css/main.css') }}">
<link rel="stylesheet" href="{{ asset('/css/login.css') }}">
<script src="{{ asset('/js/login.js') }}"></script>
<link rel="stylesheet" href="{{ asset('/bootstrap/css/bootstrap.css') }}">
<script src="{{ asset('/bootstrap/js/bootstrap.js') }}"></script>
<script src="{{ asset('js/jquery-3.3.1.min.js') }}"></script>
@endif

<script type="text/javascript">
function checkpwd(){
    if(document.getElementById('oldpwd').value ==""){
		alert("旧パスワードを入力してください。");
		return false;
    }
    if(document.getElementById("newpwd").value==""){
		alert("新パスワードを入力してください。");
		return false;
    }
    if(document.getElementById('repwd').value==""){
		alert("確認パスワードを入力してください。");
		return false;
    }
    if(document.getElementById('newpwd').value != document.getElementById('repwd').value){
		alert("確認が違います。");
		return false;
    }
    var form = document.getElementById('pschangeForm');
    form.action="/pschange/create";
    form.submit();
}
</script>
</head>
<body>
	<div class="flex-center position-ref full-height">
		<div class="content">
<form class="form-inline" id="pschangeForm" method="post">
<script>

    function reBack(){
    	window.location.href=('/login');
    }
 </script>
<table class="table table-condensed">
	<tr>
		<td>旧パスワード</td>
		<td><input type="password" class="form-control" placeholder=""
			name="oldpassword" id="oldpwd"
			value=""></td>
	</tr>
	<tr>
		<td>新パスワード</td>
		<td><input type="password" class="form-control" placeholder="" name="newpassword" id="newpwd"
			value=""></td>
	</tr>

	<tr>
		<td>新パスワード確認</td>
		<td><input type="password"
			class="form-control" placeholder="" id="repwd"
			name=""
			value=""></td>
	</tr>
</table>
<?php
     if (session('errorCode1', 0) == 1):
        echo '<div class="errorCode" >旧パスワードが間違いました。</div>';
        session()->forget('errorCode');
     endif
			?>
<table class="table table-condensed">
	<tr>
		<td><input type="button" value="確認"
			class="btn btn-primary button_normal" onclick="checkpwd()"/></td>
		<td><input type="button" value="キャンセル"
			class="btn btn-primary button_normal" onclick="reBack()" /></td>
	</tr>
</table>
</div>
</div>
<input type="hidden" name="_token" id="csrf-token" value="{{ Session::token() }}" />
</form>
</body>
</html>
